﻿namespace Core
{
    public class DSFloat : DSVar, IToInt, IToFloat
    {
        private float mValue;

        public float Value
        {
            get => mValue;
            set
            {
                mValue = value;
                onChange?.Invoke();
            }
        }

        public int ToInt() => (int)mValue;
        public float ToFloat() => mValue;
        public override string ToString() => Value.ToString();

        public override void Dispose()
        {
            if (IsDisposed) return;
            base.Dispose();

            mValue = 0;
        }
    }
}
